<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:68:"E:\WWW\waimai/app/admin/index\view\account_withdraw_order\index.html";i:1500980320;s:53:"E:\WWW\waimai/app/admin/index\view\template\base.html";i:1495522842;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link href="__STATIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <!--图标字体元件库-->
    <link rel="stylesheet" href="__STATIC__/plugins/font-awesome4.5.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="__STATIC__/admin/css/AdminLTE.min.css">
    <link rel="stylesheet" href="__STATIC__/admin/css/jquery.datetimepicker.css">
    <link rel="stylesheet" href="__STATIC__/admin/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="__STATIC__/plugins/validform/5.3.2/css/Validateform_v5.3.2.css">

    <link rel="stylesheet" href="__STATIC__/plugins/bootstrap-table/bootstrap-table.min.css">
    <link rel="stylesheet" href="__STATIC__/plugins/iCheck/polaris/polaris.css">
    <link rel="stylesheet" href="__STATIC__/plugins/iCheck/futurico/futurico.css">
    <link rel="stylesheet" href="__STATIC__/plugins/iCheck/line/_all.css">
    <link rel="stylesheet" href="__STATIC__/plugins/iCheck/square/_all.css">
    <link rel="stylesheet" href="__STATIC__/plugins/iCheck/flat/_all.css">
    <link rel="stylesheet" href="__STATIC__/plugins/iCheck/minimal/_all.css">
    

    <title><?php echo \think\Config::get('site.title'); ?></title>
    

    <script src="__STATIC__/plugins/jquery/jquery-3.0.0.min.js"></script>
    <script src="__STATIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
    <script src="__STATIC__/admin/js/app.min.js"></script>
    <script src="__STATIC__/admin/extend/app.js"></script>

    <script src="__STATIC__/admin/extend/H-ui.admin.js"></script>
    <script src="__STATIC__/plugins/layer3.0.3/layer.js"></script>
    <script src="__STATIC__/plugins/validform/5.3.2/Validform_v5.3.2_min.js"></script>

    <script src="__STATIC__/plugins/bootstrap-table/bootstrap-table.min.js" type="text/javascript"></script>
    <script src="__STATIC__/plugins/bootstrap-table/bootstrap-table-zh-CN.js" type="text/javascript"></script>

    <script src="__STATIC__/plugins/iCheck/icheck.min.js"></script>
    <script>

        var admin_menu_data=<?php if(isset($admin_menu)): ?><?php echo $admin_menu; endif; ?>;
        $(function () {
            $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
                checkboxClass: 'icheckbox_minimal-blue',
                radioClass: 'iradio_minimal-blue'
            });
        })
    </script>

    
</head>
<body class="hold-transition skin-blue-light sidebar-mini">
    
<div class="row">


    <div class="col-xs-12">
        <div class="box-body">
            <div class="row">
                <div class="col-xs-4">
                    <div class="input-group col-xs-12">
                        <span class="input-group-addon">关键字</span>
                        <input type="text" class="form-control" id="keyword" placeholder="订单号、用户名、手机、微信"/>
                    </div>
                </div>
                <div class="col-xs-4">
                    <div class="input-group">
                        <span class="input-group-addon">申请时间</span>
                        <input class="form-control datetimepicker" type="text" name="begindate"
                               id="begindate" placeholder="起始日期"/>
                        <span class="input-group-addon" style="width:1em;">至</span>
                        <input class="form-control datetimepicker" type="text" name="enddate" id="enddate"
                               placeholder="截止日期"/>
                    </div>
                </div>
                <div class=" col-xs-4">
                    <button type="button" class="btn btn-primary" id="btn_search"><i
                            class="glyphicon glyphicon-search"></i> 搜索
                    </button>
                    <!--<button type="button" class="btn btn-default" id="btn_export"><i-->
                            <!--class="glyphicon glyphicon-export"></i> 导出Excel-->
                    <!--</button>-->
                </div>
            </div>
        </div>

    </div>


    <div class="col-xs-12">
        <div class="box">
            <div class="box-body">
                <table id="table"
                       data-toggle="table"
                       data-striped="true"
                       data-query-params="requestParam"
                       data-side-pagination="server"
                       data-pagination="true"
                       data-url="<?php echo url('AccountWithdrawOrder/index_data',array('status'=>$status)); ?>"
                >
                    <thead>
                    <tr>
                        <th data-field="order_sn">订单号</th>
                        <th data-field="name">提现用户</th>
                        <th data-field="mobile">手机</th>
                        <th data-field="apply_money">申请金额</th>
                        <th data-field="finish_money">到账金额</th>
                        <th data-field="flag_status" data-formatter="formatStatus">状态</th>
                        <th data-field="create_time">申请时间</th>
                        <th data-field="verify_time" data-formatter="formatTime">审核时间</th>
                        <th data-field="finish_time" data-formatter="formatTime">到账时间</th>
                        <th data-field="operate" data-formatter="formatOperate" data-events="operateEvents" >操作</th>
                    </tr>
                    </thead>
                </table>
            </div><!-- /.box-body -->
        </div><!-- /.box -->

    </div><!-- /.col -->
</div><!-- /.row -->

</body>
<script src="__STATIC__/admin/js/skins_control.js"></script>
<script src="__STATIC__/admin/js/jquery.datetimepicker.js"></script>

<script>
    var verify_url="<?php echo url('AccountWithdrawOrder/verify'); ?>";
</script>
<script>
    // <editor-fold defaultstate="collapsed" desc="初始化日期控件">
    $('.datetimepicker').datetimepicker({
        format: "Y-m-d",
        lang: 'ch',
        timepicker: false,
        allowBlank: true
    });
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="搜索参数配置及触发事件">
    var temp = {};

    function requestParam(params) {
        temp = {
            limit: params.limit, //页面大小
            offset: params.offset, //页码
            order: params.order,
            sort: params.sort,
            search: params.search,
            keyword: $("#keyword").val(),
            begindate: $("#begindate").val(),
            enddate: $("#enddate").val()
        };
        return temp;
    }

    //搜索按钮事件
    $("#btn_search").on('click', function () {
        $('#table').bootstrapTable('refresh');
    })
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="格式化url">
    function urlFormat(url) {
        if( url.indexOf('.html')){
            url=url.replace('.html','')
        }
        return url;
    }
    // </editor-fold>
    // <editor-fold defaultstate="collapsed" desc="操作按钮">
    function formatOperate(value,row,index){
        if(row.flag_status ==0){
            return [
                '<button class="btn btn-success btn-xs row_verify" href="javascript:void(0)">',
                '<i class="fa  fa-expeditedssl"></i> 审核操作',
                '</button>'
            ].join('');
        }

    }

    // </editor-fold>
    // <editor-fold defaultstate="collapsed" desc="操作函数">
    window.operateEvents = {
        'click .row_verify': function (e, value, row, index) {
            layer_open('提现审核',urlFormat(verify_url)+"/id/"+row.id);
        }
    };

    // </editor-fold>
    // <editor-fold defaultstate="collapsed" desc="时间格式化">
    function formatTime(value) {
        if(value){
            var date = new Date(parseInt(value) * 1000);
            Y = date.getFullYear() + '-';
            M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
            D = (date.getDate() + 1 < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
            h = (date.getHours() + 1 < 10 ? '0' + (date.getHours()) : date.getHours()) + ':';
            m = (date.getMinutes() + 1 < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':';
            s = (date.getSeconds() + 1 < 10 ? '0' + (date.getSeconds()) : date.getSeconds());
            return Y + M + D + h + m + s;
        }

    }
    // </editor-fold>
    // <editor-fold defaultstate="collapsed" desc="状态格式化">
    function formatStatus(value) {
        switch(value){
            case 0:
                return '<span class="badge">待审核</span>';break;
            case 1:
                return '<span class="badge bg-green">审核通过</span>';break;
            case 2:
                return '<span class="badge bg-blue">提现到账</span>';break;
            case 3:
                return '<span>审核不通过</span>';break;
        }

    }
    // </editor-fold>

</script>

</html>